package com.bw.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * @author Monte
 * @author 644527030@qq.com
 * @author 知识改变命运，代码改变世界！
 * @date 2024年07月29日    10:27
 * @PackageName:com.bw.rabbitmq
 * @ClassName: MyConfirmCallback
 * @Description HomeController
 */

@Slf4j
public class MyConfirmCallback implements RabbitTemplate.ConfirmCallback {
    @Override
    public void confirm(CorrelationData correlationData, boolean b, String s) {
        if (b){
            log.info("消息生产成功");
        }else{
            log.error("消息生产失败");
        }
    }
}
